class PeiceItem extends eui.Image {

	private _type: number;
	private _postionX: number;
	private _postionY: number;

	public constructor(positionX, positionY, type) {
		super();
		this.type = type;
		this.postionX = positionX;
		this.postionY = positionY;
	}

	public get type() {
		return this._type;
	}

	public set type(value: number) {
		if (value == 1) this.source = "black_peice_png";
		if (value == 0) this.source = "white_peice_png";
		this._type = value;
	}

	public get postionX(): number {
		return this._postionX;
	}

	public set postionX(value: number) {
		this.x = ChessPeice.chessBoardSize * value - 19;
		this._postionX = value;
	}
	public get postionY(): number {
		return this._postionY;
	}

	public set postionY(value: number) {
		this.y = ChessPeice.chessBoardSize * value - 19;
		this._postionY = value;
	}

}